package com.yunduansing.demo.service;

import com.yunduansing.demo.entity.PostEntity;
import com.yunduansing.demo.exception.RecordExistsException;
import com.yunduansing.demo.model.common.PageRequestModel;
import com.yunduansing.demo.model.common.PageResultModel;
import com.yunduansing.demo.model.post.PostTreeModel;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yunduansing
 * @since 2020-05-24
 */
public interface PostService extends IService<PostEntity> {
    /**
     * 分页
     * @param model
     */
    PageResultModel<PostEntity> getPage(PageRequestModel model);
    /**
     * 创建
     */
    boolean create(PostEntity entity) throws RecordExistsException;
    /**
     * 修改
     */
    boolean update(PostEntity entity) throws RecordExistsException;

    List<PostTreeModel> getTree();
}
